package parkingspace;

import io.minio.MinioClient;
import io.minio.errors.InvalidEndpointException;
import io.minio.errors.InvalidPortException;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import parkingspace.entity.MinioProperties;

/**
 * ClassName: MinioApp
 * Package: parkingspace
 *
 * @author: guanzepeng
 * @Date: 2021/5/28 21:25 星期五
 * @Description:
 */
@SpringBootApplication
public class MinioApp {

	public static void main(String[] args) {
		SpringApplication.run(MinioApp.class, args);
	}

	@Bean
	public MinioClient minioClient(MinioProperties minioProperties) throws InvalidPortException, InvalidEndpointException {
		return new MinioClient(minioProperties.getEndpoint(), minioProperties.getAccessKey(), minioProperties.getSecretKey());
	}
}
